package com.gary.actors;

import org.openjdk.jcstress.annotations.*;
import org.openjdk.jcstress.infra.results.II_Result;

/**
 * @author peng_rui
 * @date 2022/7/15
 */
public class Reordering {
    @JCStressTest
    @Outcome(id = {"0, 0", "1, 1", "0, 1"}, expect = Expect.ACCEPTABLE, desc = "ACCEPTABLE")
    @Outcome(id = "1, 0", expect = Expect.ACCEPTABLE_INTERESTING, desc = "INTERESTING")
    @State
    public static class Case1 {
        private int x;
        private int y;
        @Actor
        public void test1() {
            x = 1;
            y = 1;
        }

        @Actor
        public void test2(II_Result result) {
            result.r1 = y;
            result.r2 = x;
        }
    }
}
